package com.ly.base.jdbc.dao;

import com.ly.base.jdbc.pojo.UserAccount;

import java.sql.SQLException;
import java.util.List;

/**
 * @Classname BaseServceImpl
 * @Description TODO
 * @Date 2020/11/2 16:37
 * @Author 冷心影翼
 */
public class UserAccountDao extends BaseDao<UserAccount,String> {



	public static void main(String[] args) throws SQLException {
		UserAccountDao UserAccountDao = new UserAccountDao();
		int i = UserAccountDao.deleteById("2");
		System.out.println(i);
		UserAccount c = UserAccountDao.selectById("C");
		System.out.println(c);
		c.setLeftMessageCount(22);
		int i2 = UserAccountDao.updateById(c, c.getOpenId());
		System.out.println(i2);
		int insert = UserAccountDao.insert(new UserAccount("1",33));
		System.out.println(insert);

		List<UserAccount> userAccounts = UserAccountDao.selectBySql("select left_message_count from user_account where left_message_count = ?", 0);
		UserAccountDao.updateBySql("update user_account set left_message_count = 0 where open_id = ?","oSWVX40cuDIBCEFQfkRWM9bPFz58");
		UserAccountDao.updateBySql("delete from user_account  where open_id = ?","1");
	}
}
